package com.weaponlin.domain;


import java.util.ArrayList;
import java.util.List;

class Fruit {
}

class Apple extends Fruit {
}

class Jonathan extends Apple {
}

class Other extends Jonathan {
}

class Orange extends Fruit {
}

public class GenericTest {

    public static void main(String[] args) {
        List<? extends Fruit> fruits = new ArrayList<Apple>();
//        fruits.add(new Apple());
        List<? super Apple> apples = new ArrayList<>();
        apples.add(new Jonathan());
        apples.add(new Other());
    }
}
